package algorithm.easy;

public class CountGoodRectangles1725 {

    public int countGoodRectangles(int[][] rectangles) {
        int[] ints = new int[rectangles.length];
        for (int i=0;i<rectangles.length;i++){
            ints[i] = Math.min(rectangles[i][0],rectangles[i][1]);
        }
        int res = 0;
        int max = 0;
        for (int i=0;i<rectangles.length;i++){
            if (ints[i] >max){
                max = ints[i];
                res=1;
            }else if (ints[i]==max){
                res++;
            }
        }
        return res;
    }
}
